<template>
  <div class="app-container">
    <Tinymce
      v-model="content"
      :height="attr.section==='section'?800:460"
      :img0bj="{}"
      :is-img="attr.isImg"
      @imgSizeFun="imgSizeFun"
    />
  </div>

</template>

<script>
import Tinymce from '@/components/Tinymce'

export default {
  components: {
    Tinymce
  },
  data() {
    return {
      content: '',
      attr: {
        // 是否允许上传图片
        isImg: true,
        // 标题 和 内容设置 高度不一致
        section: 'section'
      },
      imgSize: []
      /* str: '<p>该剧改编自鲁引弓的同名小说，讲述了方家、季家、乔家，三个家庭在“高三”这一年间面临高考下的悲喜故事&amp;1212</p>'*/
    }
  },
  created() {

  },
  mounted() {

  },
  methods: {
    imgSizeFun(data) {
      this.imgSize.push(data)
    },
    getimgsrc(htmlstr) {
      const reg = /<img.+?src=('|")?([^'"]+)('|")?(?:\s+|>)/gim
      const arr = []
      let tem = null
      while (tem = reg.exec(htmlstr)) {
        arr.push(tem[2])
      }
      return arr
    },
    back() {
      this.$router.back()
    }
  }
}
</script>
<style>
  p{

    margin: 0;

    padding: 0;

  }
  .article-textarea textarea {
    padding-right: 40px;
    resize: none;
    border: none;
    border-radius: 0px;
    border-bottom: 1px solid #bfcbd9;
  }
  .sub-navbar.draft {
    background: #d0d0d0;
  }
  .sub-navbar {
    height: 50px;
    line-height: 50px;
    position: relative;
    width: 100%;
    text-align: right;
    padding-right: 20px;
    -webkit-transition: 600ms ease position;
    transition: 600ms ease position;
    background: -webkit-gradient(linear, left top, right top, from(#20b6f9), color-stop(0%, #20b6f9), color-stop(100%, #2178f1), to(#2178f1));
    background: linear-gradient(90deg, #20b6f9 0%, #20b6f9 0%, #2178f1 100%, #2178f1 100%);
  }
</style>
<style scoped>
  .line {
    text-align: center;
  }
  .input-new-tag {
    width: 180px;
    vertical-align: bottom;
  }
  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
  .avatar-uploader .el-upload:hover {
    border-color: #409EFF;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
  }
  .avatar-uploader-icon:hover{
    border-color: #409EFF;
    border-radius: 6px;
  }
  .avatar {
    width: 178px;
    height: 178px;
    display: block;
  }
  .video-box {
    width: 1000px;
    padding: 20px;
  }

</style>
